<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
        <meta name="format-detection" content="telephone=no" />
		<!-- 禁止数字识自动别为电话号码 -->
        <title>{__WECHAT_NAME__}</title>
        <link rel="stylesheet" href="{__TLP__}css/zc-dl.css">
		<script language="javascript" type="text/javascript">
			var PW_PATH='{__PW_PATH__}';
		</script>
        <script src="{__TLP__}js/jquery-2.1.3.min.js"></script>
        <script src="{__PW_PATH__}statics/core.js" language="javascript"></script>
		<script language="javascript" type="text/javascript">
        document.getElementsByTagName("html")[0].style.fontSize=document.documentElement.clientWidth/16+"px";
		
		var wait=30; 
			
		function time() {  
			
			if (wait == 0) {  
				$('#djs').removeClass('r_inp_b_dis');
				$('#djs').attr("disabled",false);            
				$('#djs').text("获取验证码");  
				wait = 30;  
			} else {  
				$('#djs').attr("disabled", true);  
				$('#djs').text("重新发送(" + wait + ")");  
				wait--;  
				setTimeout(function() {  
					time();  
				},  
				1000) 
			}  
		}  
		
		$(document).ready(function(){
			$('#djs').click(function(){
				if($('#djs').attr("disabled"))
				{
					return false;
				}
				else
				{
					$.post('{__SITE_URL__}api/sms/index.php?telephone='+$("#telephone").val(), function(data) {
						if(data=='2')
						{
							$('#djs').addClass('r_inp_b_dis');
							time();
						}
						else
						{
							showToast('短信发送失败，请重试['+data+']',false);
						}
					});
					
				}
			});
			
			$('#dosubmit').click(function(){
				
				$.post('{U(MOD,'getpwd')}', $("#getpwdform").serialize(), function(data) {
					if(data=='success')
					{
						showToast('密码修改成功','{U(MOD,'login')}');
					}
					else if(data<0)
					{
						if(data==-1)
						{
							showToast('该手机号不存在',false);
						}
						else
						{
							showToast('错误异常，注册失败['+data+']',false);
						}
					}
					else
					{
						msg=$("#"+data).attr("msg");
						
						showToast(msg,false);
					}
				});
			});
		});
        </script>
        
        <style>
        ::-webkit-input-placeholder { /* WebKit browsers */color:#ccc;}
        :-moz-placeholder { /* Mozilla Firefox 4 to 18 */color:#ccc;}
        ::-moz-placeholder { /* Mozilla Firefox 19+ */color:#ccc;}
        :-ms-input-placeholder { /* Internet Explorer 10+ */color:#ccc;}
        a:link,a:visited,a:hover{
        text-decoration: none;
        color: none;
        }
        a:active{
           color: none; 
        }
        </style>
    </head>
    <body style="background: #f9f8f9;">
       <form action="{U(MOD,'getpwd')}" name="getpwdform" id="getpwdform" target="target" method="post">
            <input type="hidden" name="dosubmit" value="1">
            <div class="r_m">
                <input class="inp r_inp" type="text" name="telephone" id="telephone" msg="请输入手机号" placeholder="请输入手机号">
                <input class="inp r_inp_y" type="text" name="smscode" id="smscode" msg="验证码不正确" placeholder="请输入验证码">
                <a class="r_inp_b" href="javascript:void(0);" id="djs">获取验证码</a> 
                <input class="inp r_inp" type="password" name="userpwd" id="userpwd" msg="密码由6-32位字符组成" placeholder="请输入新密码">
                <input class="inp r_inp" type="password" name="reuserpwd" id="reuserpwd" msg="两次密码输入不一致" placeholder="确认新密码">
            </div>            
            <div class="jy_ann">
                <input class="sub dj_z" type="button" id="dosubmit" value="重置登录密码">
            </div>
        </form>
        <div class="r_lj">
            <a class="r_dl fl" href="{U(MOD,'login')}">已有账号，登录</a>
            <a class="r_wm fr" href="{U(MOD,'register')}">没有账号，注册</a>
        </div>
    </body>


   <script type="text/javascript">
$(function(){
    document.body.addEventListener('touchstart', function () {
         //...空函数即可
        });  
    
});

</script>
</html>
